package cn.tedu.csmall.passport.controller;

import cn.tedu.csmall.passport.pojo.vo.RoleItemListVo;
import cn.tedu.csmall.passport.service.IRoleService;
import cn.tedu.csmall.passport.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Api(tags =  "02 角色模块")
@RestController
@RequestMapping("/roles")
public class RoleController {
    @Autowired
    IRoleService roleService;

    @GetMapping("")
    @ApiOperation("查询角色列表")
    @ApiOperationSupport(order = 410)
    public JsonResult<List<RoleItemListVo>> list(){
        List<RoleItemListVo> list = roleService.list();
        return JsonResult.ok(list);
    }
}
